package com.lord.label.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lord.label.dao.RuleDao;
import com.lord.label.domain.Rule;
import com.lord.label.service.RuleService;

/**
 * 
 * @Description: 规则业务实现逻辑类
 * @author Lord
 * @date 2017年5月23日 下午3:13:10
 */
@Service
public class RuleServiceImpl implements RuleService {

	@Autowired
	private RuleDao ruledao;
	
	@Override
	public int insert(Rule rule) {
		return ruledao.insertSelective(rule);
	}

	@Override
	public int delete(Long id) {
		return ruledao.deleteByPrimaryKey(id);
	}

	@Override
	public int update(Rule rule) {
		return ruledao.updateByPrimaryKeySelective(rule);
	}

	@Override
	public Rule findById(Long id) {
		return ruledao.selectByPrimaryKey(id);
	}

	@Override
	public List<Rule> findAll() {
		return ruledao.findAll();
	}

	@Override
	public Rule findBySite(String webSite) {
		return ruledao.findBySite(webSite);
	}

}
